package mapper.user;

import org.apache.ibatis.annotations.Param;
import pojo.SysUser;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    //查询总记录数
    public int count();

    //查询用户列表
    public List<SysUser> getUserList();

    //根据用户姓名模糊查询用户
    public List<SysUser> getUserByRealName(String realName);

    //查询用户列表
    public List<SysUser> getUserListByPojo(SysUser sysUser);

    //查询用户列表
    public List<SysUser> getUserListByMap(Map<String,Object> userMap);

    //查询用户列表
    public List<SysUser> getUserListByParams(@Param("realName") String realName,@Param("roleId") int roleId);

    //查询用户列表包括角色名称
    public List<SysUser> getUserListWithRoleName(SysUser sysUsers);

    //根据角色id查询用户
    public List<SysUser> getUserListByRoleId(@Param("roleId") Integer roleId);

    //根据用户id查询用户及相关地址
    public List<SysUser> getUserAndAddressesByUserId(@Param("userId") Integer userId);

    //添加用户
    public int add(SysUser user);

    //修改用户
    public int modify(SysUser user);

    //修改个人密码
    public int updatePwd(@Param("id") Integer id, @Param("password") String pwd);

    //删除用户
    public int deleteUserById(@Param("id")Integer id);

    //根据角色ID删除用户
    public int deleteUserByRoleId(@Param("roleId")Integer roleId);

    //根据角色ID查询用户数量
    public int selectCount(@Param("roleId")Integer roleId);

    //查询用户列表分页查询
    public List<SysUser> selectList(@Param("realName")String realName,@Param("roleId") Integer roleId);

    //查询用户列表分页查询
    public List<SysUser> selectListByChoose(@Param("realName")String realName,@Param("roleId") Integer roleId,@Param("account") String account,@Param("createdTime") Date createdTime);

    //根据角色ID查询用户信息
    public List<SysUser> selectListByRoleIdArray(Integer[] roleIds);

    //根据角色id集合查询用户信息
    public List<SysUser> getUserByRoleIdList(List<Integer> roleList);

    //根据角色id集合查询用户信息
    public List<SysUser> getUserByRoleIdMap(Map<String, Object> roleIdMap);

    //分页查询用户列表
    public List<SysUser> selectPageList(@Param("realName")String realName,@Param("roleId") Integer roleId,@Param("pageBegin") Integer pageBegin,@Param("pageSize") Integer pageSize);


}
